#ifndef HEAD_H
#define HEAD_H
#define IS_TEST 0
#include <iostream>
#include <fstream>
#include <vector>
#include <queue>
#include <unordered_map>
#include <unordered_set>

#ifndef null
#define null NULL
#endif

class Coordinate
{
public:
    int x, y; // x为横坐标，y为纵坐标,注意这里是格子坐标系下的坐标
    inline Coordinate(int x = 0, int y = 0) : x(x), y(y){}
    inline Coordinate(const Coordinate &co) : x(co.x), y(co.y){}
    inline bool operator==(const Coordinate &other) { return x == other.x && y == other.y; }
    inline void turn90ClockWise(int t){  // 以0，0为中心
        t = t % 4;
        int temp = 0;
        switch(t){
        case 0:
            break;
        case 1:
            temp = x;
            x=-y;
            y = temp;
            break;
        case 2:
            x = -x;
            y = -y;
            break;
        case 3:
            temp = x;
            x = y;
            y = -temp;
            break;
        }
    }
    inline Coordinate operator+(const Coordinate &c){
        return Coordinate(this->x + c.x,this->y + c.y);
    }
    inline Coordinate& operator+=(const Coordinate &c){
        this->x += c.x;
        this->y += c.y;
        return *this;
    }
};

namespace shape
{
// 总共有几部分// 参见 enum ShapePosition
const static int PARTS_NUM_OF_EACH_LEVEL = 4;
// 堆叠的最大高度
const static int MAX_LEVEL = 1; // 放弃堆叠器
// shape hash id 分割char
const static char shape_split_char = '0';
// 标准字符长
const static int STD_LENGTH_SERIALIZED_STRING = MAX_LEVEL * (1 + 2*PARTS_NUM_OF_EACH_LEVEL) - 1;
} // namespace shape

namespace grid
{
const static int HEIGHT = 60;
const static int WIDTH = 90;
const static int EACH_MAP_LENGTH = 10;
} // namespace grid

#endif
